﻿mainScreen = ExtendClass(MonoUI)

-------------------- 深入底层 Start --------------------
local k, v = debug.getlocal(1, 1)
print("getlocal1:", "k:", tostring(k), "v:", tostring(v))
k, v = debug.getlocal(1, 2)
print("getlocal2:", "k:", tostring(k), "v:", tostring(v))
k, v = debug.getlocal(1, 3)
print("getlocal3:", "k:", tostring(k), "v:", tostring(v))
k, v = debug.getlocal(1, -1)-- -1 is the first vararg argument
print("getlocal-1:", "k:", tostring(k), "v:", tostring(v))
k, v = debug.getlocal(1, -2)
print("getlocal-2:", "k:", tostring(k), "v:", tostring(v))

local var = {...}
for k, v in pairs(var) do
	print("var:", k, v)
end

local var = debug.getinfo(1)
print("getupvalue1:", debug.getupvalue(var.func, 1))
print("_G:", _G)

print("getupvalue2:", debug.getupvalue(var.func, 2))
-------------------- 深入底层 End --------------------

mainScreen.button_handle = nil
function mainScreen:Awake()
    self.btn_1 = self:GetUObj("btn_1", Button)
end

function mainScreen:Start()
    
end

function mainScreen:OnEnable()
    self.button_handle = function()
        local param = OpenUIParam()
        param.UseMask = true
        param.CloseByMask = true
        UIKit.Instance:OpenUICS("msgBox", MsgBox(), param, "↑:w  ↓:s  ←:a  →:d  Fire:MouseLeftClick\n Do U Remember?", "Tips");
    end
    self.btn_1.onClick:AddListener(self.button_handle)
end

function mainScreen:OnDisable()
    self.btn_1.onClick:RemoveListener(self.button_handle)
end

function mainScreen:OnDestroy()

end